/// @brief
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <queue>

typedef long long ll;

template <typename T>
inline T &read(T &x) {
  x = 0;
  bool f = false;
  short ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = true;
    ch = getchar();
  }
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ '0'), ch = getchar();
  if (f) x = -x;
  return x;
}

const int N = 2e6 + 5, mod = 1e9 + 7;
char str[N];
int n, m, k, f[N], lst[N];
std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >,
                    std::greater<std::pair<int, int> > >
    pq;

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen64("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen64("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("CF645E Intellectual Inquiry.in", "r", stdin);
  freopen("CF645E Intellectual Inquiry.out", "w", stdout);
#endif
#endif

  read(n), read(k);
  scanf("%s", str + 1);
  m = strlen(str + 1);
  for (int i = 1; i <= m; ++i) {
    if (!lst[str[i] - 'a']) {
      f[i] = ((f[i - 1] << 1) + 1) % mod;
    } else {
      f[i] = ((f[i - 1] << 1) - f[lst[str[i] - 'a'] - 1]) % mod;
      if (f[i] < 0) f[i] += mod;
      if (f[i] >= mod) f[i] -= mod;
    }
    lst[str[i] - 'a'] = i;
  }
  for (int i = 0; i < k; ++i) { pq.push(std::make_pair(lst[i], i)); }
  for (int i = 1; i <= n; ++i) {
    int mn = pq.top().first, c = pq.top().second;
    pq.pop();
    int now = i + m;
    if (mn == 0) {
      f[now] = ((f[now - 1] << 1) + 1) % mod;
    } else {
      f[now] = ((f[now - 1] << 1) - f[mn - 1]) % mod;
      if (f[now] < 0) f[now] += mod;
      if (f[now] >= mod) f[now] -= mod;
    }
    lst[c] = now;
    pq.push(std::make_pair(now, c));
  }
  printf("%d", f[n + m] + 1);
  return 0;
}